Skip to content

Conversation

typotter
Copy link
Collaborator

Available by upgrading to the latest version of the common SDK

@@ -63,6 +81,12 @@ public static class Builder {
private long pollingIntervalMs = DEFAULT_POLLING_INTERVAL_MS;
private String host = DEFAULT_HOST;

// Assignment and bandit caching on by default. To disable, call
// `builder.assignmentCache(null).banditAssignmentCache(null);`
private IAssignmentCache assignmentCache = new LRUInMemoryAssignmentCache(100);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much of this configuration should we surface to devs?
The cache size or ttl? or the IAssignmentCache. Or should we surface as a set of caching options on the builder, similar to JS (ex: withLruAssignmentCaching(100), withExpiringCache(10, MINUTES) etc)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the option of providing convenience methods like withLruAssignmentCaching and withExpiringCache, however we should also allow users to bring their own implementation of IAssignmentCache, so we also need a withAssignmentCache that takes the interface. EDIT: Looks like you already added it below, so we're good on that one

@typotter typotter requested review from aarsilv and felipecsl October 28, 2024 14:19
Copy link
Contributor

@felipecsl felipecsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking, just a couple of comments

build.gradle Outdated
@@ -31,7 +31,7 @@ repositories {

dependencies {
// Re-export classes and interfaces that will be used upstream
api 'cloud.eppo:sdk-common-jvm:3.3.1'
api 'cloud.eppo:sdk-common-jvm:3.5.0-SNAPSHOT'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you probably don't need this to be a snapshot version anymore since v3.5.0 has been released, right? same below line 43

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

boolean isGracefulModel) {
boolean isGracefulModel,
IAssignmentCache assignmentCache,
IAssignmentCache banditAssignmentCache) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Add @Nullable or @NonNull annotations as needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -63,6 +81,12 @@ public static class Builder {
private long pollingIntervalMs = DEFAULT_POLLING_INTERVAL_MS;
private String host = DEFAULT_HOST;

// Assignment and bandit caching on by default. To disable, call
// `builder.assignmentCache(null).banditAssignmentCache(null);`
private IAssignmentCache assignmentCache = new LRUInMemoryAssignmentCache(100);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the option of providing convenience methods like withLruAssignmentCaching and withExpiringCache, however we should also allow users to bring their own implementation of IAssignmentCache, so we also need a withAssignmentCache that takes the interface. EDIT: Looks like you already added it below, so we're good on that one

@typotter typotter merged commit 452cddf into main Oct 28, 2024
4 checks passed
@typotter typotter deleted the tp/common-latest branch October 28, 2024 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants